package name.panitz.ludens.strategy;
class MoveStone implements SetStone{
  Position from ;
  Position to;
  MoveStone(Position from, Position to){
    this.from=from;
    this.to=to;
  }
  public  Position getPosition(){return to;}

  public Muehle move(Muehle m){
    Muehle result=(Muehle)m.clone();
    //result.lastColumn=to.triblet;
    //result.lastRow=to.pos;
    result.movesDone=(byte)(m.movesDone+1);
    result.playerStartStones[m.player%2]
     =m.playerStartStones[m.player%2];
    result.playerStartStones[m.nextPlayer()%2]
     =m.playerStartStones[m.nextPlayer()%2];
    result.b[to.triblet][to.pos]=m.player;
    result.b[from.triblet][from.pos]=Muehle.NONE;
    result.player=m.nextPlayer();
    return result;
  }

  @Override
  public String toString(){
    return "["+from+" -> "+to+"]";
  }
}

